package com.zhixue.media.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zhixue.media.dto.*;
import com.zhixue.media.po.MediaFiles;
import com.zhixue.model.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

/**
 * @Auther: 李 力
 * @Date: 2025/4/14
 * @Description: com.zhixue.service
 * @version: 1.0
 */
public interface MediaFilesService extends IService<MediaFiles> {

    UploadFileResultDto upload(MultipartFile multipartFile, Long companyId,String objectName);

    PageResult<MediaFiles> selectPageList(Long companyId, PageParams pageParams, QueryMediaParamsDto paramsDto);

    MediaFiles addMediaFilesToDb(Long companyId, String fileMd5, UploadFileParamsDto uploadFileParamsDto, String bucket, String objectName);

    RestResponse<Boolean> checkFile(String fileMd5);

    RestResponse<Boolean> checkChunk(String fileMd5, Integer chunk);

    RestResponse<Boolean> uploadChunk(MultipartFile file, String fileMd5, Integer chunk);

    RestResponse mergeChunks(Long companyId, String fileMd5, int chunkTotal, UploadFileParamsDto uploadFileParamsDto);

    File downloadFileFromMinIO(String bucket, String objectName);

    boolean upLoadToMinio(String bucket, String path, String object, String type);

    RestResponse<String> getFileById(String id);
}
